<template>
  <a-layout id="home-page">
    <a-layout-sider v-model:collapsed="collapsed" :trigger="null" collapsible>
      <div class="logo"/>
      <Sidebar/>
    </a-layout-sider>
    <a-layout>
      <a-layout-header style="background: #fff; padding: 0">
        <MenuFoldOutlined
          class="trigger"
          v-show="!collapsed"
          @click="() => (collapsed = !collapsed)"
        />
        <MenuUnfoldOutlined 
          class="trigger"
          v-show="collapsed"
          @click="() => (collapsed = !collapsed)"
        />
      </a-layout-header>
      <a-layout-content
        :style="{ margin: '24px 16px', padding: '10px', background: '#fff', minHeight: '280px' }"
      >
        <router-view></router-view>
      </a-layout-content>
    </a-layout>
  </a-layout>
</template>

<script setup lang="ts">
import {ref} from 'vue'
import Sidebar from '@/components/home/sidebar.vue'

let collapsed = ref(false)
</script>

<style lang="less" scoped >
#home-page {
  min-height: 100vh;
  .logo {
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    margin: 16px;
  }
  .trigger {
    font-size: 18px;
    line-height: 64px;
    padding: 0 24px;
    cursor: pointer;
    transition: color 0.3s;
  }
  .trigger:hover {
    color: #1890ff;
  }
} 
</style>
